use tokio::sync::mpsc;
use tokio::sync::mpsc::UnboundedSender;
use crate::connection_manager::event::ConnectionEvent;
use crate::station::output_station::{OutputEvent, OutputStation};

pub mod output_station;

// 暂时放弃
pub fn start_output_station<C: ConnectionEvent + 'static, E: OutputEvent<E, C> + 'static>(stream_sender:UnboundedSender<C>) -> UnboundedSender<E> {
    let (sender, receiver) = mpsc::unbounded_channel();

    tokio::spawn(async move {
        let output_manager: OutputStation<E, C> = OutputStation::new(stream_sender);
        output_manager.run(receiver)
    });

    sender

}